package com.langsin.crmpro.action;

import java.util.HashSet;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;

import com.langsin.crmpro.base.BaseAction;
import com.langsin.crmpro.manager.DictionaryManager;
import com.langsin.crmpro.model.SDictionaryClass;
import com.langsin.crmpro.model.SDictionaryDetail;

public class DictionaryAction extends BaseAction {
	
	private String code;
	
	private Set<SDictionaryDetail> SDictionaryDetails = new HashSet<SDictionaryDetail>(
			0);
	
	private DictionaryManager dictionaryManager;
	
	public void setDictionaryManager(DictionaryManager dictionaryManager) {
		this.dictionaryManager = dictionaryManager;
	}
	
	public String getDictionaryDetails()throws Exception{
		SDictionaryClass dictionary = dictionaryManager.getDictionaryByCode(this.code);
		this.SDictionaryDetails = dictionary.getSDictionaryDetails();
		return SUCCESS;
	}
	
	

	public Set<SDictionaryDetail> getSDictionaryDetails() {
		return SDictionaryDetails;
	}

	public void setSDictionaryDetails(Set<SDictionaryDetail> dictionaryDetails) {
		SDictionaryDetails = dictionaryDetails;
	}

	public String getCode()
	{
		return code;
	}

	public void setCode(String code)
	{
		this.code = code;
	}


}
